
CC=gcc
CCOPT=-c -Wall
CCSHAREDOPT=-fpic
CCDEBUGOPT=-g
CSHARED=-shared -Wl,-soname

all: create read

create: test_create
	@echo
	@echo Running CREATE test...
	@sleep 1
	./test_create
	@echo CREATE done
	@sleep 1
	@echo

read: test_read
	@echo
	@echo Running READ test 1...
	@sleep 1
	./test_read testing.1
	@echo
	@echo Running READ test 2...
	@sleep 1
	./test_read testing.2.lzo
	@echo READ done
	@echo

test_create: test_create.o lzop_support.o liblzop.o
	$(CC) -o test_create test_create.o lzop_support.o liblzop.o -llzo2

test_read: test_read.o lzop_support.o liblzop.o
	$(CC) -o test_read test_read.o lzop_support.o liblzop.o -llzo2

lzop_support.o: ../lzop_support.o
	cp ../lzop_support.o .

liblzop.o: ../liblzop.o
	cp ../liblzop.o .

test_create.o: test_create.c ../lzop.h
	$(CC) $(CCOPT) test_create.c

test_read.o: test_read.c ../lzop.h
	$(CC) $(CCOPT) test_read.c

clean:
	rm -f *.o

clean-all: clean
	rm -f test_create test_read testing.1
